home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / ddx / sprite.X11R3 / hdr / cg4reg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-04  |  2.7 KB  |  117 lines

  1. /* @(#)cg4reg.h 1.7 88/06/09 SMI */
  2.  
  3. /*
  4.  * Copyright 1986 by Sun Microsystems, Inc.
  5.  */
  6.  
  7. #ifndef    cg4reg_DEFINED
  8. #define    cg4reg_DEFINED
  9.  
  10. /*
  11.  * Prism frame buffer hardware definitions.
  12.  *
  13.  * The cg4 device has an overlay plane, enable plane and eight planes
  14.  * of color/grayscale pixel read/write memory.  There are no rasterop chips 
  15.  * or planes register.  All memory is on board memory.
  16.  *
  17.  * There are two flavors of cg4.  The A type has AMD DACS in the I/O space
  18.  * and a status register.  The B type has a Brooktree BT458 DAC in the
  19.  * memory space.
  20.  */
  21.  
  22. /* number of colormap entries */
  23. #define CG4_CMAP_ENTRIES    256
  24.  
  25. #ifdef sun3
  26.  
  27. /* number of known cg4 types */
  28. #define    CG4_NTYPES        2
  29.  
  30. /* A type (AMD DAC) definitions */
  31. #define    CG4A            0
  32.  
  33. /* frame buffer and color map addresses */
  34. #define CG4A_ADDR_OVERLAY    0xFF000000
  35. #define CG4A_ADDR_ENABLE    0xFE400000
  36. #define CG4A_ADDR_COLOR        0xFE800000
  37. #define CG4A_ADDR_CMAP        0x000E0000
  38.  
  39. /* frame buffer and color map address spaces */
  40. #define CG4A_PGT_FB        PGT_OBMEM
  41. #define CG4A_PGT_CMAP        PGT_OBIO
  42.  
  43. /* colormap/status register structure */
  44. struct cg4a_cmap {
  45.     u_char red[CG4_CMAP_ENTRIES];
  46.     u_char green[CG4_CMAP_ENTRIES];
  47.     u_char blue[CG4_CMAP_ENTRIES];
  48.     u_char status;
  49. #define CG4A_STATUS_FIRSTHALF    0x80
  50. #define CG4A_STATUS_TOOLATE    0x40
  51. };
  52.  
  53. /* B type (Brooktree DAC) definitions */
  54.  
  55. /* frame buffer and color map addresses */
  56. #define CG4B_ADDR_OVERLAY    0xFF400000
  57. #define CG4B_ADDR_ENABLE    0xFF600000
  58. #define CG4B_ADDR_COLOR        0xFF800000
  59. #define CG4B_ADDR_CMAP        0xFF200000
  60.  
  61. /* frame buffer and color map address spaces */
  62. #define CG4B_PGT_FB        PGT_OBMEM
  63. #define CG4B_PGT_CMAP        PGT_OBMEM
  64.  
  65. #endif sun3
  66. #ifdef sun4
  67.  
  68. /* number of known cg4 types */
  69. #define    CG4_NTYPES        1
  70.  
  71. /* B type (Brooktree DAC) definitions */
  72.  
  73. /* frame buffer and color map addresses */
  74. #define CG4B_ADDR_OVERLAY    0xFB400000
  75. #define CG4B_ADDR_ENABLE    0xFB600000
  76. #define CG4B_ADDR_COLOR        0xFB800000
  77. #define CG4B_ADDR_CMAP        0xFB200000
  78.  
  79. /* frame buffer and color map address spaces */
  80. #define CG4B_PGT_FB        PGT_OBIO
  81. #define CG4B_PGT_CMAP        PGT_OBIO
  82.  
  83. #endif sun4
  84. #ifdef sun3x
  85.  
  86. /* number of known cg4 types */
  87. #define    CG4_NTYPES        1
  88.  
  89. /* B type (Brooktree DAC) definitions */
  90.  
  91. /* frame buffer and color map addresses */
  92. #define CG4B_ADDR_OVERLAY    0x50400000
  93. #define CG4B_ADDR_ENABLE    0x50600000
  94. #define CG4B_ADDR_COLOR        0x50800000
  95. #define CG4B_ADDR_CMAP        0x50200000
  96.  
  97. /* frame buffer and color map address spaces -- not used on sun3x */
  98. #define CG4B_PGT_FB        0
  99. #define CG4B_PGT_CMAP        0
  100.  
  101. #endif sun3x
  102.  
  103.  
  104. /* colormap structure */
  105. struct cg4b_cmap {
  106.     u_char    addr;        /* address register */
  107.     char    fill0[3];
  108.     u_char    cmap;        /* color map data register */
  109.     char    fill1[3];
  110.     u_char    ctrl;        /* control register */
  111.     char    fill2[3];
  112.     u_char    omap;        /* overlay map data register */
  113.     char    fill3[3];
  114. };
  115.  
  116. #endif    !cg4reg_DEFINED
  117.